home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTreeUI$TreeIncrementAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  2.0 KB  |  62 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5.  
  6. public class BasicTreeUI$TreeIncrementAction extends AbstractAction {
  7.    // $FF: synthetic field
  8.    private final BasicTreeUI this$0;
  9.    protected int direction;
  10.    private boolean addToSelection;
  11.    private boolean changeSelection;
  12.  
  13.    public BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, int var2, String var3) {
  14.       this(var1, var2, var3, false, true);
  15.    }
  16.  
  17.    private BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, int var2, String var3, boolean var4, boolean var5) {
  18.       this.this$0 = var1;
  19.       this.direction = var2;
  20.       this.addToSelection = var4;
  21.       this.changeSelection = var5;
  22.    }
  23.  
  24.    // $FF: synthetic method
  25.    BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, BasicTreeUI.1 var2, int var3, String var4, boolean var5, boolean var6) {
  26.       this(var1, var3, var4, var5, var6);
  27.    }
  28.  
  29.    public void actionPerformed(ActionEvent var1) {
  30.       int var2;
  31.       if (this.this$0.tree != null && this.this$0.treeSelectionModel != null && (var2 = this.this$0.getRowCount(this.this$0.tree)) > 0) {
  32.          int var3 = BasicTreeUI.access$5(this.this$0);
  33.          int var4;
  34.          if (var3 == -1) {
  35.             if (this.direction == 1) {
  36.                var4 = 0;
  37.             } else {
  38.                var4 = var2 - 1;
  39.             }
  40.          } else {
  41.             var4 = Math.min(var2 - 1, Math.max(0, var3 + this.direction));
  42.          }
  43.  
  44.          if (this.addToSelection) {
  45.             BasicTreeUI.access$7(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var4));
  46.          } else if (this.changeSelection) {
  47.             this.this$0.tree.setSelectionInterval(var4, var4);
  48.          } else {
  49.             BasicTreeUI.access$6(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var4), true);
  50.          }
  51.  
  52.          this.this$0.ensureRowsAreVisible(var4, var4);
  53.          this.this$0.lastSelectedRow = var4;
  54.       }
  55.  
  56.    }
  57.  
  58.    public boolean isEnabled() {
  59.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  60.    }
  61. }
  62.